﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="MakeRequisition.aspx.cs" Inherits="PresentationLayer.MakeRequisition" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1
        {
            width: 233px;
        }
        .auto-style2
        {
            height: 40px;
        }
        .auto-style3
        {
            width: 233px;
            height: 40px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align="center">
    
        <h2>Make Requisition</h2>
        
        <asp:Label ID="lblError" runat="server" ForeColor="#FF3300"></asp:Label>
        
        <br />
        <asp:ValidationSummary ID="ValidationSummary1"
        HeaderText="You must enter a value in the following fields:"
        DisplayMode="BulletList"
        EnableClientScript="true"
        runat="server" ForeColor="Red"/>

        <table class="table-condensed">
            <tr>
                <td>
                     <label>Category:</label>
                </td>
                <td class="auto-style1">
                        <asp:DropDownList ID="ddlCategory" CssClass="form-control" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged" Width="172px" ></asp:DropDownList>
                   
                     
                </td>
                <td>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ErrorMessage="Please Choose Category" Text="*" ControlToValidate="ddlCategory" InitialValue="Choose Category..."></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="auto-style2">
                    <label>Item Name:</label>
                </td>
                <td>
                     <asp:DropDownList ID="ddlStationery" CssClass="form-control" runat="server" Width="283px"></asp:DropDownList>
                </td>
                <td>

                </td>
            </tr>
            <tr>
                <td>
                    <label>Quantity:</label> 
                </td>
                <td class="auto-style1">
                     <asp:TextBox ID="txtQty" CssClass="form-control" runat="server"></asp:TextBox>
                    
                    
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtQty" Text="*" ErrorMessage="Please Enter number"></asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" Text="*" Type="Integer" 
                        MinimumValue="1" MaximumValue="1000" ErrorMessage="Value must be a number" ControlToValidate="txtQty"></asp:RangeValidator>
                </td>
            </tr>
           <tr>
               <td> <asp:Button ID="btnAdd" CssClass="btn-primary pull-left" runat="server" Text="Add Item" OnClick="btnAdd_Click" /></td>
               <td>
                   
               </td>
               <td></td>
           </tr>
        </table>

        
        <br />

            <asp:GridView ID="gvTempItemList" runat="server" AutoGenerateColumns="False"    OnRowDeleting="gvTempItemList_RowDeleting" CssClass="table-condensed table-hover table-striped table-bordered" >
                <Columns>
                     <asp:BoundField DataField="ItemCode" HeaderText="Item Code" HeaderStyle-CssClass="Hide" ItemStyle-CssClass="display:none;">
                        <HeaderStyle CssClass="Hide"></HeaderStyle>
                        <ItemStyle CssClass="display:none;"></ItemStyle>
                     </asp:BoundField>
                    
                     <asp:BoundField DataField="ItemName" HeaderText="Item Name">
                         <ItemStyle BorderStyle="Solid" />
                     </asp:BoundField>
                    <asp:BoundField DataField="Category" HeaderText="Category">
                         <ItemStyle BorderStyle="Solid" />
                     </asp:BoundField>
                     <asp:BoundField DataField="Qty" HeaderText="Quantity">
                         <ItemStyle BorderStyle="Solid" />
                     </asp:BoundField>
                    <asp:CommandField ShowDeleteButton="True" ButtonType="Button" DeleteText="Remove"   >
                   
                    
                     <ControlStyle CssClass="btn-danger" />
                     </asp:CommandField>
                   
                    
                 </Columns>

            </asp:GridView>
            <br />
            <asp:Button ID="btnSubmit" CausesValidation="false" CssClass="btn-primary" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
            <br />
        </div>           

    <br />
</asp:Content>

